package com.ccc.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ccc.model.Role;
import com.ccc.util.dao.UtilDao;

@Component("roleDao")
public class RoleDaoImpl implements com.ccc.dao.RoleDao {
	private UtilDao utilDao;

	@Override
	public void addRole(Role role) {
		utilDao.save(role);
	}

	@Override
	public void deleteRole(Role role) {
		utilDao.delete(role);
	}

	@Override
	public void updateRole(Role role) {
		utilDao.update(role);
	}

	@Override
	public Role findRole(int id) {
		return utilDao.find(Role.class, id);
	}
	
	@Override
	public List<Role> findRole(String hql,Object[] o){
		return utilDao.find(hql, o);
	}

	public UtilDao getUtilDao() {
		return utilDao;
	}

	@Resource
	public void setUtilDao(UtilDao utilDao) {
		this.utilDao = utilDao;
	}

}
